<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
	contentType="text/html; charset=UTF-8"%>
<%@page import="org.apache.bsf.engines.javascript.JavaScriptEngine"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>录入人员信息</title>
<link rel="stylesheet" type="text/css"
	href="jquery/jquery-ui-1.8.19.custom.css" />
<link rel="stylesheet" type="text/css" href="jquery/flexigrid.pack.css" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script type="text/javascript" src="jquery/jquery.min.js"></script>
<script type="text/javascript"
	src="jquery/jquery-ui-1.8.19.custom.min.js"></script>
<script type="text/javascript" src="jquery/flexigrid.pack.js"></script>
<script type="text/javascript" src="script/commons.js"></script>
<script type="text/javascript" src="script/calendar.js"></script>
<script type="text/javascript" src="script/objects.js"></script>
<style type="text/css">
.title {
	text-align: right;
	width: 70px;
}

.value {
	text-align: left;
}

.big {
	width: 210px;
}

.small {
	width: 170px;
}
</style>
<style type="text/css">
#syncWidth div { /*width: 100%;*/
	
}
</style>
<script type="text/javascript">
	function check(s) {
		$("#toExcel").val(s);
		$("form").submit();
	}
	
	$(function(){
		var gridHeight = window.screen.availHeight - 350;
		$("#mainTable").flexigrid({height:gridHeight});
	});
</script>
</head>
<body>
	<html:form action="receiptexcel.do" method="post">
		<div id="syncWidth">
			<div class="button_bar xbutton_bar_img bottomBorder">
				<input type="button" onclick="to('forwardReceiptadd.do')" value="新增" />
				<input type="button" onclick="deleteSelected('r', false)" value="删除" />
				<input type="button" onclick="deleteSelected('r', true)" value="记账" />
				&nbsp;&brvbar;&nbsp;&nbsp;
				<input type="button" onclick="check('false')" value="查询" />
				<input type="button" onclick="check('true')" value="导出" />
				<html:hidden property="toExcel" styleId="toExcel" />
			</div>
			<div class="button_bar">
				<table height="50" class="query_form_table">
					<tr>
						<th class="title">客户名称：</th>
						<th class="big value"><html:text property="customer"
								styleClass="paddingText" styleId="cus"></html:text>
						</th>
						<th class="title">费用性质：</th>
						<th class="small value"><label><html:checkbox
									property="gatherWay" value="现金">现金</html:checkbox>
						</label>&nbsp;<label><html:checkbox property="gatherWay"
									value="支票">支票</html:checkbox>
						</label>
						</th>
						<th class="title">单据状态：</th>
						<th class="value"><label><html:checkbox
									property="isClosed" value="1">已记账</html:checkbox>
						</label>&nbsp; <label><html:checkbox property="isClosed" value="0">未记账</html:checkbox>
						</label>
						</th>
					</tr>
					<tr>
						<th class="title">制单日期：</th>
						<th class="big value"><html:text property="writeDate_Begin"
								styleClass="calendar" onclick="show_cele_date(this,'','',this)"
								onfocus="show_cele_date(this,'','',this)"></html:text> - <html:text
								property="writeDate_End" styleClass="calendar"
								onclick="show_cele_date(this,'','',this)"
								onfocus="show_cele_date(this,'','',this)"></html:text>
						</th>
						<th class="title">日期：</th>
						<th class="value" colspan="3"><html:text
								property="receiptDate_Begin" styleClass="calendar"
								onclick="show_cele_date(this,'','',this)"
								onfocus="show_cele_date(this,'','',this)"></html:text> - <html:text
								property="receiptDate_End" styleClass="calendar"
								onclick="show_cele_date(this,'','',this)"
								onfocus="show_cele_date(this,'','',this)"></html:text>
						</th>
					</tr>
				</table>
			</div>
			<table id="mainTable">
				<thead>
					<tr>
						<th width="20"><input type="checkbox"
							onclick="checkAllChecker()" />
						</th>
						<th width="80">单据编号</th>
						<th width="90">日期</th>
						<th width="90">制单日期</th>
						<th width="90">记账日期</th>
						<th width="70">制单人</th>
						<th width="200">渠道名称</th>
						<th width="80">收款方式</th>
						<th width="100" class="price">金额（元）</th>
						<th width="200">备注</th>
					</tr>
				</thead>
				<c:if test="${listsize!=0}">
					<tbody>
						<c:forEach var="list" items="${list}" varStatus="i">
							<tr>
								<td class="list_data_text"><c:if test="${!list.isClosed}">
										<input type="checkbox" name="checker"
											value="${list.receiptId}"
											onpropertychange="changeColor(this)" />
									</c:if>
								</td>
								<td class="list_data_number"><c:if test="${!list.isClosed}">
										<a href="forwardReceiptadd.do?modifyId=${list.receiptId}">A${list.receiptId}</a>
									</c:if> <c:if test="${list.isClosed}">
    A${list.receiptId}
    </c:if>
								</td>
								<td class="list_data_text">${list.receiptDate}</td>
								<td class="list_data_text">${list.writeDate}</td>
								<td class="list_data_text closeDate"><c:choose>
										<c:when test="${list.closeDate == null}">
    -
    </c:when>
										<c:otherwise>
    ${list.closeDate}
    </c:otherwise>
									</c:choose>
								</td>
								<td class="list_data_text">${list.finUser.uname}</td>
								<td class="list_data_text">${list.finCustomer.customer}</td>
								<td class="list_data_text">${list.gatherWay}</td>
								<td class="list_data_text sumPrice separators price">${list.receiptPrince}</td>
								<td class="list_data_text">${list.receiptRemark}</td>
							</tr>
						</c:forEach>
						<tr>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
							<td class="footer separators price">Sum：<span id="sumPrice">0</span>
							</td>
							<td>&nbsp;</td>
						</tr>
					</tbody>
				</c:if>
			</table>
		</div>
	</html:form>
</body>
</html>